Learning Objectives

After completing this lesson, you’ll be able to:

What Are Parameters?

Parameters are controls that define how FME operates; for example, how a reader reads data, how a transformer transforms it, and how a writer writes it. Almost every component in FME has parameters of one type or another. You've already run into them while using FME. In this course, we'll look closer at how they work and how you can allow the person running the workspace to control them at run-time.

Note

This course focuses on the use of parameters in FME Form. However, parameters are also important for constructing self-serve workflows in FME Flow. We recommend completing this course first and then checking out Build Basic Self-Serve Workflows and Build Versatile Self-Serve Workflows when you are ready to learn about parameters in FME Flow. We cover those courses in the FME Flow Authoring learning path.

Types of Parameter

When looking at the types of parameters, it’s helpful first to consider the types of people who use FME and their role in the process.

Workspace authors are the people who design and create a workspace. Authors use FME Workbench and set parameters to control how the workspace runs.

Workspace users are the people who make use of a workspace without necessarily having created it first. Users might have little knowledge of FME and may never have used FME Workbench, but they may still need to set parameters to control how the workspace runs.

In light of these two roles, we can say there are two different types of parameters: FME parameters (for authors to use) and user parameters (for FME users to use).

Note

The concept of workspace users who have never heard of FME sounds like an oxymoron. However, FME is an enterprise integration platform. People may use FME at that level without having any knowledge of FME. In fact, users on the client side of FME Flow might be using a custom web page or application that uses FME to process the data behind the scenes. So it's entirely possible to set workspace parameters without even knowing what a workspace is!

FME Parameters

FME parameters are those built into the FME Workbench interface. They directly control a translation and can be found in various places. FME parameters can be located in:

For example, here are some writer parameters shown in the Navigator:

Viewing writer parameters

Here, for example, are the FME parameters for a text file writer. They include options to overwrite or append to an existing text file and the type of character encoding that should be used.

These are parameters the workspace author will use. The user is not expected to set these because they are not assumed to have enough experience of Workbench to know where to find the parameter or how to set it.

For example, the author might decide that the byte order mark should not be written in this output.

Setting a writer parameter

They double-click the parameter to open a dialog in which they can change the parameter value.

Note

In case you were wondering, the Byte Order Mark (aka BOM) is a special character found in the header of a text file. It denotes whether the text is in a Unicode encoding, which Unicode encoding it is, and what the endianness of the text is. It helps different applications to read the data correctly.

You want to know what "endianness" means now, don't you?! I bet you wouldn't guess it has something to do with boiled eggs...

User Parameters

User parameters are those that are created by an FME author, but for an FME user to use. In other words, they are a way for the end-user of the workspace to provide their input, regardless of where and how the workspace is being used.

Creating a User Parameter

User parameters appear in a particular section of the Navigator window, labeled User Parameters. Here, for example, two user parameters have been defined:

Each of these user parameters allows the end-user of a workspace to enter information into the translation; whether to process line features and what color to write them in.

You can create user parameters in two ways.

The Navigator

One is directly in the Navigator by right-clicking on User Parameters and choosing Manage User Parameters:

Creating a user parameter

The Parameter Manager dialog lets you create or edit user parameters. You can create a new one by clicking the green plus icon: Add user parameter. You can choose from many types of user parameters, letting you ensure the user enters the correct information, e.g., a number or a file path.

User parameter types

Once you choose a type, the right side of the Parameter Manager shows the configuation options. Here's an example where the author is creating a parameter in which the user can enter their name:

Configuring a user name user parameter

Note

⭐New for FME 2023.0:  since FME 2021.0, you can create Group Boxes using the Parameter Manager, which allow you to arrange your user parameters like they are presented in FME transformers. Now in FME 2023.0, you can add conditional logic controlling groups to guide the user when they are filling out the parameters. See the documentation for more details.

In Situ

The second way of creating a user parameter is in situ. You can do this in the Navigator by right-clicking a parameter and choosing Create User Parameter, or in a transformer dialog by clicking the right-pointing arrow and choosing User Parameter > Create User Parameter. This method is convenient and fast, because it automatically links the newly-created user parameter to the FME parameter you started with (more on linking in a later lesson).

However, it is less flexible than the first method. Workbench will automatically choose a parameter type that matches the FME parameter you started with, but sometimes you might want to restrict the options more than this method allows. For example, if you use this method to create a user parameter for the format of a Generic writer, the user will be able to pick from any available FME writer format, which is often overwhelming and can lead to errors.

Note

Try using the in situ method first. If you need a more flexible solution, you can delete the created user parameter and make a new one from scratch.

You can also copy, paste, and duplicate user parameters. This allows the workspace author to duplicate existing parameters and make changes instead of having to build several near-identical parameters from scratch:

Duplicating a user parameter

This includes being able to paste a parameter definition into a different workspace from which it was copied.

Entering Information into a User Parameter

Once a user parameter is defined, the workspace can be run in Prompt for Parameters mode, set in the Run menu and enabled by default:

Prompt for Parameters setting in the Run menu

With this mode activated in FME Workbench, the user is prompted to supply values through a simple dialog:

Translation Parameter Values dialog

In FME Flow, the user is prompted through a web page:

User parameter values can also be set using the FME Flow REST API, allowing developers to interact with FME workspaces programmatically.

Using a User Parameter

Getting input from a user is pointless if it is not used, so doing something with that input is necessary.

User parameters can be employed in several places. Firstly, they can be tied to an FME parameter (more information on that in the next section), but they can also be used to provide values to transformers and attributes in a workspace.

For example, here, the author is making use of the color and username parameters (in the FeatureColorSetter and AttributeManager transformers):

Using user parameters

The author set up these transformers to use the parameter as input by selecting it in the transformer like so:

Supplying a value to a transformer parameter with a user parameter

When the workspace is run, the end user can select the color of features to write, enter their name into a text field, and have it entered into the UpdatedBy attribute in the output.

Note

A screenshot above shows a workspace with parameter prompts and feature caching enabled.

Be aware that a prompt is only provided for a parameter used in the section of the workspace being run. In other words, a partial run that fetches data from caches may prevent a parameter prompt if that parameter is not used in that partial run.